package com.whlilong.jxc.editor.support;

import org.eclipse.jface.viewers.ComboBoxCellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;

import com.whlilong.jxc.listener.IEditorListener;
import com.whlilong.jxc.listener.IModifyListener;

public class GoodsInfoComboBoxCellEditor extends ComboBoxCellEditor {

	protected IEditorListener listener;
	private int currentColumn;
	private IModifyListener modify;
	
	public GoodsInfoComboBoxCellEditor(Composite parent, IEditorListener listener,
			int column, IModifyListener modify,
			String[] items) {
		super(parent, items,SWT.READ_ONLY|SWT.BORDER|SWT.RIGHT);
		this.currentColumn = column;
		this.listener = listener;
		this.modify = modify;
	}
	
	public void releaseKey() {
		fireApplyEditorValue();
		deactivate();
	}

	@Override
	protected void fireApplyEditorValue() {
		super.fireApplyEditorValue();
		this.modify.modify();
	}

}
